package com.abberbex;

import org.newdawn.fizzy.Body;
import org.newdawn.fizzy.Rectangle;
import org.newdawn.fizzy.StaticBody;
import org.newdawn.fizzy.World;
import org.newdawn.slick.GameContainer;

/**
 * Provides boundaries for game, objects can not leave container.
 * @author Brendan Dickerson
 *
 */
public class Room {
	
	private Rectangle floorBounds;
	private Body<?> floorBody;
	private Body<?> ceilingBody;
	private Rectangle wallBounds;
	private Body<?> rwallBody;
	private Body<?> lwallBody;

	public Room(GameContainer cont, World level) 
	{

		floorBounds = new Rectangle((float)cont.getWidth(),1f);
		floorBounds.setOffset(0, 0, 0);
		floorBody = new StaticBody<Object>(floorBounds,0f,cont.getHeight());
		floorBody.setRestitution(0);
		floorBody.setFriction(0f);

		level.add(floorBody);	
		
		ceilingBody = new StaticBody<Object>(floorBounds,0,0);
		ceilingBody.setRestitution(0);
		
		
		level.add(ceilingBody);
		
		wallBounds = new Rectangle(0, (float)cont.getHeight());
		rwallBody = new StaticBody<Object>(wallBounds,cont.getWidth(), 0);
		rwallBody.setRestitution(0);
		lwallBody = new StaticBody<Object>(wallBounds, 0, 0);
		lwallBody.setRestitution(0);
		
		level.add(rwallBody);
		level.add(lwallBody);
	}

}
